package mr.go.set.tests;

import static org.junit.Assert.assertArrayEquals;
import mr.go.set.AggregatedSet;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ShellsortTestCase {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public final void testShellsortArray() {
		Integer[] array1 = new Integer[] { 5, 5, 4, 10, 10, 1, 10, 4, 5, 5 };
		Integer[] array2 = new Integer[] { 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5,
				1, 2, 10, 5 };
		AggregatedSet.shellsort(array1);
		AggregatedSet.shellsort(array2);
		assertArrayEquals(new Integer[] { 1, 4, 4, 5, 5, 5, 5, 10, 10, 10 },
				array1);
		assertArrayEquals(new Integer[] { 1, 1, 2, 2, 3, 4, 5, 5, 5, 5, 5, 5,
				5, 5, 5, 10 }, array2);
	}

}
